<extend name="Layout/ins_page" />
<block name="content">

	{:W('PageHeader/simple',array('name'=>$row_info['name'].':所属成员','search'=>'S'))}
	<div class="oprator-panel">
		<a onclick="go_return_url()" class="btn">返回</a>
		<div class="split"></div>
		<a id="btn_add" class="btn">添加成员</a>
		<a id="btn_del" class="btn btn-del">删除</a>
	</div>
	<!-- 列表显示区域  -->
	<div class="sub-frame">
		<form id="form_data" name="form_data" method="post" >
			<input type="hidden" name="group_id" id="group_id" value="{$row_info.id}">
			<div class="frame">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th class="x-checkbox col-4">
							<input  type="checkbox" class="toggle-select-all" data="user_id[]" />
							</th>
							<th>
							<nobr>
								员工编号
							</nobr></th>
							<th>
							<nobr>
								姓名
							</nobr></th>
							<th>
							<nobr>
								部门
							</nobr></th>
							<th class="hidden">
							<nobr>
								职级
							</nobr></th>
							<th>
							<nobr>
								职位
							</nobr></th>
							<th>
							<nobr>
								状态
							</nobr></th>
						</tr>
					</thead>
					<tbody class="tbody">
						<volist name="user_list" id="data">
							<tr id="{$data.id}">
								<td class="x-checkbox col-4">
								<input  type="checkbox" name="user_id[]" value="{$data.id}" />
								</td>
								<td>
								<nobr>
									{$data.emp_no}
								</nobr></td>
								<td>
								<nobr>
									{$data.name}
								</nobr></td>
								<td>
								<nobr>
									{$data.dept_name}
								</nobr></td>
								<td class="hidden">
								<nobr>
									{$data.rank_name}
								</nobr></td>
								<td>
								<nobr>
									{$data.position_name}
								</nobr></td>
								<td>
								<nobr>
									{$data.is_del|status}
								</nobr></td>
							</tr>
						</volist>
					</tbody>
				</table>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use('global', function() {
			var $ = layui.jquery;
			//保存后关闭
			$('#btn_save').on('click', function() {
				send_form('form_data', '{:U("save")}', '', function(ret) {
					if (ret.status == 1) {
						parent.layer.msg(ret.info);
						parent.location.reload(true);
					} else {
						parent.layer.msg(ret.info);
						return false;
					}
				});
			});
			$('#btn_add').on('click', function() {
				winopen("{:U('add_user',array('group_id'=>$row_info['id']))}", 560, 470);
			});
			$('#btn_del').on('click', function() {
				if ($("input:checked[name='user_id[]']").length < 1) {
					layer.msg("请选择用户");
					return false;
				};
				send_form("form_data", "{:U('del_user')}", "__SELF__");
			});
		});

	</script>

</block>